import request from "../request"

export interface LoginParams {
	platformType: string,
	username: string,
	password: string
}

export interface RegisterParams {
	phone: string,
	email: string,
	password: string
}

export interface ForgotParams {
	phone: string,
	email: string,
	password: string
}

export interface GetVerificationCodeParams {
	verificationType: string,
}



class login {
	async getlogin(params: LoginParams) {
		return await request.post('/auth/login', params)
	}
	
	async getPlatformInfo() {
		return await request.post('/auth/getPlatformInfo')
	}
	
	async registerUser(params: RegisterParams) {
		return await request.post('/auth/registerUser', params)
	}
	
	async getVerificationCode(params: GetVerificationCodeParams) {
		return await request.post('/auth/getVerificationCode', params)
	}

	// 忘记密码
	async getForgotPassword(params: ForgotParams) {
		return await request.post('/auth/getForgotPassword',params)
	}

	// 修改密码
	async getChangePassword(params:any) {
		return await request.post('/auth/getChangePassword',params)
	}
}



export default new login()